package singleton.demo3;

public class YaFactory1 {

    private static YaFactory1 yaFactory ;

    private String name = "鸭厂";

    private YaFactory1(){
    }

    public static YaFactory1 getInstance(){
        if (yaFactory == null){
            yaFactory = new YaFactory1();
        }
        return yaFactory;
    }

//    // 静态内部类
//    static class Helper{
//        final static YaFactory1 FACTORY = new YaFactory1();
//
//
//
//    }
}
